//
//  PushTool.h
//  爆米花视频
//
//  Created by mac on 14-11-3.
//  Copyright (c) 2014年 mac. All rights reserved.
//  推送消息

#import <Foundation/Foundation.h>
@class AppUpdate;
// 推送消息block
typedef void(^PushSuccessBlock)(NSString *ret);
typedef void(^PushFailureBlock)(NSError *error);

// 注册用户block
typedef void(^RegisterSuccessBlock)(NSString *uid);
typedef void(^RegisterFailureBlock)(NSError *error);

// 检测新版本
typedef void(^CheckVersionSuccessBlock)(NSString *version);
typedef void(^CheckVersionFailureBlock)(NSError *error);

// 检查更新回调block
typedef void (^AppUpdateSuccessBlock)(AppUpdate *update);
typedef void (^AppUpdateFailureBlock)(NSError *error);

@interface PushTool : NSObject

#pragma mark - 注册推送设备
+ (void)pushWithUserId:(long long)userId deviceToken:(NSString *)token success:(PushSuccessBlock)success failure:(PushFailureBlock)failure;

#pragma mark - 注册用户
+ (void)registerWithSip:(NSString *)ipAddress userId:(NSString *)userId success:(RegisterSuccessBlock)success failure:(RegisterFailureBlock)failure;



#pragma mark - 检测新版本
+ (void)checkVersionWithVersion:(NSString *)version success:(CheckVersionSuccessBlock)success failure:(CheckVersionFailureBlock)failure;
+ (void)appUpdateSuccess:(AppUpdateSuccessBlock)success failure:(AppUpdateFailureBlock)failure;

@end
